home *** CD-ROM | disk | FTP | other *** search
/ .net 2002 March / DotNetMagazine-Issue107-Coverdisc-NET107-02-03-PCMac.bin / pc / PC Software / free_browsing / DavesQckSearchDbar3-14 / dqsd.exe / searches / dir.xml < prev    next >
Text File  |  2002-09-24  |  3KB  |  87 lines

  1. <search function="dir">
  2.   <name>Driving Directions</name>
  3.   <description>
  4.     Get Driving directions from one place to another<br/>
  5.    <div class="helpboxDescLabels">Useage:</div>
  6.    <table class="helpboxDescTable">
  7.     <tr><td>dir <I>[street,] city, state</I> [to <I>[street,] city, state</I>]</td></tr>
  8.    </table>
  9.    <div class="helpboxDescLabels">Examples:</div>
  10.    <table class="helpboxDescTable">
  11.     <tr><td>dir New York,NY</td></tr>
  12.     <tr><td>dir Laconia, NH to Bristol, CT</td></tr>
  13.     <tr><td>dir 1200 Pensylvania Ave, Washington, DC to 1 Duvall St, Key West, FL</td></tr>
  14.    </table>
  15.   </description>
  16.   <category>Travel</category>
  17.   <link>http://www.mapquest.com</link>
  18.   <contributor>Peter Heath</contributor>
  19.   
  20.   <script><![CDATA[
  21.       function dir(q)
  22.       {
  23.         if (q=="") {
  24.             openSearchWindow("http://service.bfast.com/bfast/click?bfmid=27359743&siteid=31123317&bfpage=drivingdir");
  25.             return;
  26.         }
  27.  
  28.         //DEFAULTS
  29.         var StartCountry="";
  30.         var EndCountry="";
  31.         var StartZip="";
  32.         var EndZip="";
  33.         var StartZip4="";
  34.         var EndZip4="";
  35.   
  36.         if ( nullArgs("dir", q) )
  37.               return false;
  38.           else
  39.           {
  40.                 var start = "";
  41.                 var finish = "";
  42.  
  43.             parseddirs = q.split(" to ");
  44.             start = parseddirs[0];
  45.             finish = parseddirs[1];
  46.  
  47.             parsedloc = start.split(",");
  48.             if (typeof parsedloc[2] == 'undefined'){ //has no Street
  49.                 StartState = (parsedloc[1] ? parsedloc[1] : "");
  50.                 StartCity  = (parsedloc[0] ? parsedloc[0] : "");
  51.                 StartStreet = "";
  52.             } else { //has street
  53.                 StartState = (parsedloc[2] ? parsedloc[2] : "");
  54.                 StartCity  = (parsedloc[1] ? parsedloc[1] : "");
  55.                 StartStreet= (parsedloc[0] ? parsedloc[0] : "");
  56.             }
  57.             if (typeof parseddirs[1] == 'undefined'){ //has only 1 location
  58.                 SearchPage = "http://www.mapquest.com/maps/map.adp?addtohistory=&country="+StartCountry+"&address="+StartStreet+"&city="+StartCity+"&state="+StartState+"&zipcode="+StartZip+"&historyid=&submit.x=0&submit.y=0";
  59.                 openSearchWindow(SearchPage);
  60.             } else {    //has 2 locations
  61.                 parsedloc = finish.split(",");
  62.                 if (typeof parsedloc[2] == 'undefined'){ //has no Street
  63.                     EndState = (parsedloc[1] ? parsedloc[1] : "");
  64.                     EndCity  = (parsedloc[0] ? parsedloc[0] : "");
  65.                     EndStreet = "";
  66.                 } else { //has street
  67.                     EndState = (parsedloc[2] ? parsedloc[2] : "");
  68.                     EndCity  = (parsedloc[1] ? parsedloc[1] : "");
  69.                     EndStreet= (parsedloc[0] ? parsedloc[0] : "");
  70.                 }
  71.                     
  72.                 var SearchPage="http://www.mapquest.com/directions/main.adp?go=1&do=nw&ct=NA&1y=" + StartCountry + "&1a=" + StartStreet + "&1p=&1c=" + StartCity + "&1s=" + StartState + "&1z=" + StartZip + "&1ah=" + StartZip4 + "&2y=" + EndCountry + "&2a=" + EndStreet + "&2p=&2c=" + EndCity + "&2s=" + EndState + "&2z=" + EndZip + "&2ah=" + EndZip4 + "&lr=2&x=95&y=14";
  73.                      openSearchWindow(SearchPage);
  74.               }
  75.  
  76.           }
  77.       }
  78.   ]]></script>
  79.  
  80.   <copyright>
  81.     Copyright (c) 2002 David Bau
  82.     Distributed under the terms of the
  83.     GNU Public License, Version 2 (http://www.gnu.org/copyleft/gpl.txt)
  84.   </copyright>
  85. </search>
  86.  
  87.